<script setup>
import { computed, ref } from 'vue';
import SysUser from '@/views/SystemManage/SysUser/Child/PcUser/PcUser.vue'

const emits = defineEmits(['close', 'init', 'reload'])
const props = defineProps({
  curRow: {
    type: Object,
    default: () => ({})
  },
})
// 弹窗标题
const title = computed(() => props.curRow.name + ' - 用户管理')
// 是否显示弹窗
const show = ref(false);
// 弹窗显示状态切换时触发
const afterOpenChange = bool => {
  if (!bool) {
    emits('close')
  }
};
// 筛选参数
const params = computed(() => ({ roleId: props.curRow.id }))
// 打开弹窗
const open = () => {
  show.value = true;
};
defineExpose({ open })
</script>

<template>
  <a-drawer :maskClosable="false" :closable="false" destroyOnClose v-model:open="show" class="custom-class"
    root-class-name="root-class-name" :title="title" placement="right" @after-open-change="afterOpenChange"
    width="1400px">
    <SysUser :params="params" />
    <template #footer>
      <div style="display: flex;gap: 5px;">
        <a-button type="primary" ghost @click="show = false">关闭</a-button>
      </div>
    </template>
  </a-drawer>
</template>